<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			.box{
				text-align: center;
			}
			.box #btn{
				margin: auto;
				width: 50px;
				line-height: 50px;
				background: #ddd;
				border-radius: 50%;
				color: #fff;
				cursor: pointer;
			}
		</style>
	</head>
	<body>
		<div class="box">
			<div id="btn">开</div>
			<img src="img/pic_bulboff.gif"/>
		</div>
	</body>
	<script type="text/javascript">
		var btn = document.getElementById('btn')
		var img = document.querySelector('img')
		btn.onclick = function () {
			if (this.innerHTML == '开') {
				this.innerHTML = '关'
				this.style.background = "green"
				img.src = "img/pic_bulbon.gif"
			} else{
				this.innerHTML = '开'
				this.style.background = "#ddd"
				img.src = "img/pic_bulboff.gif"
			}
		}
	</script>
</html>
